import service from "@/utils/request";

// 查询目录列表
export const getDirectoryListApi = (params) =>
    service({
        url: "/subject/directory",
        params,
    });

// 查询单个目录
export const getDirectoryInfoApi = (id) =>
    service({
        url: "/subject/directory/" + id,
    });

// 添加目录
export const addDirectoryApi = (data) =>
    service({
        url: "/subject/directory",
        method: "post",
        data,
    });

// 修改目录
export const editDirectoryApi = data=>
    service({
        url: "/subject/directory/" +data.id,
        method: "PUT",
        data,
    });

// 删除目录
export const delDirectoryApi = (id) =>
    service({
        url: "/subject/directory/" + id,
        method: "DELETE",
    });

// 获取学科树状结构数据
export const getSubjectTreeApi = () =>
    service({
        url: "/subject/tree",
    });
